// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   delete_ok.java

package ecommerce.website.link;

import include.get_sql.getInsertSql;
import include.nseer_cookie.*;
import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;
import validata.ValidataNumber;
import validata.ValidataTag;

public class delete_ok extends HttpServlet
{

	public delete_ok()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		try
		{
			HttpSession dbSession = request.getSession();
			JspFactory _jspxFactory = JspFactory.getDefaultFactory();
			javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
			ServletContext dbApplication = dbSession.getServletContext();
			HttpSession session = request.getSession();
			ServletContext context = session.getServletContext();
			String path = context.getRealPath("/");
			nseer_db_backup1 ecommerce_db = new nseer_db_backup1(dbApplication);
			ValidataNumber validata = new ValidataNumber();
			ValidataTag vt = new ValidataTag();
			counter count = new counter(dbApplication);
			getInsertSql getInsertSql = new getInsertSql();
			getAttachmentLength getAttachmentLength = new getAttachmentLength();
			getAttachmentType getAttachmentType = new getAttachmentType();
			if (ecommerce_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String link_ID = request.getParameter("link_ID");
				String sql1 = (new StringBuilder("delete from ecommerce_link where link_ID='")).append(link_ID).append("'").toString();
				ecommerce_db.executeUpdate(sql1);
				sql1 = (new StringBuilder("delete from ecommerce_link_file where link_ID='")).append(link_ID).append("'").toString();
				ecommerce_db.executeUpdate(sql1);
				ecommerce_db.commit();
				ecommerce_db.close();
				response.sendRedirect("ecommerce/website/link/delete_list.jsp");
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
